/**
  * 背包面板
  
  
  
  */
module game {

    export class ShopMediator extends BaseMediator {
        public static NAME: string = "ShopMediator";

        public constructor(viewComponent: any = null) {
            super(ShopMediator.NAME, viewComponent);
        }

        public listNotificationInterests(): Array<any> {
            return [
                PanelNotify.OPEN_SHOP,
                PanelNotify.CLOSE_SHOP
            ];
        }
        private shopPanel: ShopPanel = new ShopPanel();
        public handleNotification(notification: puremvc.INotification): void {
            var data: any = notification.getBody();
            switch (notification.getName()) {
                case PanelNotify.OPEN_SHOP: {
                    //显示角色面板
                    this.showUI(this.shopPanel, false, 0, 0, 6);
                    break;
                }
                case PanelNotify.CLOSE_SHOP: {
                    this.closePanel(1);
                    break;
                }
            }
        }


        /**
             * 初始化面板ui
             */
        public initUI(): void {
            this.shopPanel.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.closeButtonClick, this);
        }
        /**
         * 初始化面板数据
         */
        public initData(): void {


        }
       


        private closeButtonClick(event: egret.TouchEvent): void {
            this.closePanel(1);
        }
    }
}